// 引入封装的axios
import request from '@/utils/request';
//定义用户信息接口类型
export interface UserInfoData {
    name: string;
    avatar: string;
    roles: string[];//角色权限字符串数组
    routes: string[];//菜单权限字符串数组
    buttons: string[];//按钮权限字符串数组
}

// 登录
export function login(username: string, password: string) {
    return request.post<any,{token: string}>('/admin/acl/index/login', {username, password});
}

// 获取用户基础信息
export function getUserInfo() {
    return request.get<any, UserInfoData>('/admin/acl/index/info')
}

//  用户退出登录
export function logout() {
    return request.post<any, any>('/admin/acl/index/logout');
}
